import requeat from '../utils/request'
import { setHeaders } from './configHeaders'

//前缀
const urlPrefix = 'admin'

const headers = {
	'Authorization': localStorage.getItem(`${urlPrefix}_token`)
}

export function login(params={}){
	return requeat({
		url:`/${urlPrefix}/login`,
		method:'post',
		params,
		
	})
}
export function register(params={}){
	return requeat({
		url:`/${urlPrefix}/register`,
		method:'post',
		params
	})
}
export function getMenu(params={}){
	return requeat({
		url:`/${urlPrefix}/getMenu`,
		method:'get',
		headers:{
			'Authorization': localStorage.getItem(`${urlPrefix}_token`)
		},
		params,
	})
}
export function get_admin(params={}){
	return requeat({
		url:`/${urlPrefix}/get_admin`,
		method:'get',
		headers:{
			'Authorization': localStorage.getItem(`${urlPrefix}_token`)
		},
		params,
	})
}

export default{
	login,
	register,
	getMenu,
	get_admin,
}